<template>
  <el-menu
    :default-active="activeIndex"
    :mode="mode"
  >
    <MenuItem
      v-for="(menu, index) in data"
      :key="index"
      :data="menu"
    />
  </el-menu>
</template>

<script>
import MenuItem from './menuItem.vue'
export default {
  components: {
    MenuItem
  },
  props: {
    data: {
      type: Array,
      default: () => ([])
    },
    mode: {
      type: String,
      default: 'horizontal'
    }
  },
  setup () {
    return {
      activeIndex: ref('')
    }
  }
}
</script>

<style lang="less" scoped>
</style>
